package com.zxj.controller;

import com.seventh.common.pojo.R;
import com.zxj.pojo.entity.TbBrand;
import com.zxj.pojo.entity.TbCar;
import com.zxj.pojo.entity.TbCarTypeConfigDetails;
import com.zxj.pojo.vo.BrandVo;
import com.zxj.pojo.vo.ConfigVo;
import com.zxj.service.CarBrandService;
import com.zxj.service.CarConfigService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @program: clms-seventh
 * @description:
 * @author: 张修杰
 * @create: 2021-07-24 17:21
 **/
@RestController
@RequestMapping("lease/carBrand")

public class CarBrandController {
    @Resource
    CarBrandService carBrandService;
    @ApiOperation(value = "初始化汽车查询信息")
    @PostMapping("initCarBrandTable/{currentPage}/{pageSize}")
    public R initCarBrandTable(@PathVariable Integer currentPage,
                                @PathVariable Integer pageSize,
                                @RequestBody BrandVo brandVo){
        return carBrandService.findAllCarBrandPage(currentPage,pageSize,brandVo);
    }
    @ApiOperation(value = "修改汽车信息")
    @PutMapping("updateCarBrandById")
    public R updateCarConfigById(@RequestBody TbBrand tbBrand){
        return carBrandService.updateCarBrandById(tbBrand);
    }

    @ApiOperation(value = "修改回显 汽车信息")
    @GetMapping("selectCarBrandById/{id}")
    public R selectCarBrandById(@PathVariable String id){
        return carBrandService.selectCarBrandById(id);
    }
    @ApiOperation(value = "新增汽车信息")
    @PutMapping("insertCarBrand")
    public R insertCarBrand(@RequestBody TbBrand tbBrand){
        return carBrandService.insertCarBrand(tbBrand);
    }
    @ApiOperation(value = "删除汽车信息")
    @GetMapping("deleteCarBrand/{id}")
    public R deleteCarBrand(@PathVariable String id){
        return carBrandService.deleteCarBrand(id);
    }
    @ApiOperation(value = "汽车品牌信息")
    @GetMapping("selectAllCarBrand")
    public R selectAllCarBrand(){ return carBrandService.selectAllCarBrand();}
    @ApiOperation(value = "汽车品牌")
    @PostMapping("selectCarBrand")
    public R selectCarBrand(@RequestBody TbBrand tbBrand){ return carBrandService.selectCarBrand(tbBrand);}

}
